<!DOCTYPE html>
<html>
<head>
     <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
     <title>Map类</title>
     <link rel="stylesheet" type="text/css" href="http://localhost:8080/testA/arcgisjs/js/dojo/dijit/themes/tundra/tundra.css"/>
   <script type="text/javascript" src="http://localhost:8080/testA/arcgisjs/init.js"></script>
     <link rel="stylesheet" type="text/css" href="http://localhost:8080/testA/arcgisjs/js/esri/css/esri.css" />
</head>
 <script type="text/javascript">
 
 require(['esri/map','esri/geometry/Extent','test/MeasureLength','esri/layers/ArcGISTiledMapServiceLayer',"dojo/parser",'esri/geometry/Point',
          "esri/layers/GraphicsLayer","dojo/domReady!"],
		 function(map1,Extent,MeasureLength,ArcGISTiledMapServiceLayer,parser,Point,GraphicsLayer){
	     parser.parse();
	  	var url ="http://cache1.arcgisonline.cn/arcgis/rest/services/ChinaOnlineCommunity/MapServer"; 
	  	
	  	var url2 = "http://services.tianditugd.com:8080/2f9qgl/DLG_PAD/wmts";
	  	
	  	
	  	
	  	
	  	
		  var initialExtent = new esri.geometry.Extent({
			   "xmin":6971056.979606233,
	           "xmax":16363639.015286192,
	           "ymin":1932328.0750486827,
	           "ymax":7152059.8625854105,
	           "spatialReference":
	           {"wkid":102100}
			  });
		  
		  var myMap = new map1('arcgisDiv',{ 
				  //center : [-98, 40] , 不能与extent同时存在
			  extent:initialExtent
		  });
		   
		  
		  var layerInfo = new WMTSLayerInfo({
			    identifier: "world",
			    tileMatrixSet: "EPSG:4326",
			    format: "gif"
			  });
			  var options = {
			    serviceMode: "KVP",
			    layerInfo: layerInfo
			  };

			  var wmtsLayer = new WMTSLayer("http://v2.suite.opengeo.org/geoserver/gwc/service/wmts", options);
			  myMap.addLayer(wmtsLayer);
		  
/*
 * 
		      var myTiledMapServiceLayer = new ArcGISTiledMapServiceLayer(url);
		      myMap.addLayer(myTiledMapServiceLayer);
		      myMap.addLayer(new GraphicsLayer({id:"other"}));
		      dojo.connect(dojo.byId('test'), "onclick", measure);
		      dojo.connect(myMap, "onClick", function(e){
		      });
		      function measure(){
		    	 
		    	  myMap.centerAndZoom(new Point(116,24), myMap.getMaxZoom() - 1);
		   	    var t1 = new MeasureLength();
		   	 myMap.setMapCursor("url(cursor_linemeasure.cur),auto");
		   	     MeasureLength.action(myMap);
		     }
		     function zoom(){
		    	 myMap.centerAndZoom(new Point(45,35), map.getMaxZoom() - 1);
		     }
 
 */ 
 })
 
      </script>
      <body class="tundra">
       <div id="arcgisDiv" style="width:900px; height:600px; border:1px solid #000;"></div>
       <button id="test">测试复位</button>
      </body>
  </html>